<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/11/9
  Time: 16:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-3.6.0.min.js"></script>
</head>
<body>

</body>
</html>
<script>
    //请求后台
    $.post("demo10Servlet",function(obj) {
        console.log(obj);


        //接收json类型的对象       直接可以使用属性
        //console.log(obj.age,obj.name,obj.sex)



        //接收json类型数组  直接遍历
        // for(var i = 0; i < obj.length; i++) {
        //     console.log(obj[i]);
        // }


        //接收混合模式
        for(var i = 0; i < obj.length; i++) {
            console.log(obj[i].name,obj[i].age)
        }
    },"json")
</script>
